core.items¶
This module allows runtime creation and removal of items. It will also remove any links from an Item before it is removed.
-
core.items.
add_item
(item_or_item_name, item_type=None, category=None, groups=None, label=None, tags=[], gi_base_type=None, group_function=None)¶ Adds an Item using a ManagedItemProvider.
- Parameters
item_or_item_name (Item or str) – Item object or name for the Item to create
item_type (str) – (optional, if item_oritem_name is an Item) the type of the Item
category (str) – (optional) the category (icon) for the Item
groups (str) – (optional) a list of groups the Item is a member of
label (str) – (optional) the label for the Item
tags (list) – (optional) a list of tags for the Item
gi_base_type (str) – (optional) the group Item base type for the Item
group_function (GroupFunction) – (optional) the group function used by the Item
- Returns
The Item that was created or None
- Return type
Item or None
- Raises
TypeError – if item_or_item_name is not an Item or string, or if item_or_item_name is not an Item and item_type is not provided
-
core.items.
remove_item
(item_or_item_name)¶ This function removes an Item using a ManagedItemProvider.
- Parameters
item_or_item_name (Item or str) – the Item object or name for the Item to create
- Returns
the Item that was removed or None
- Return type
Item or None